<template>
	<view class="bg-img">
		<view class="download_box text-center">
			<view class="jui_flex_col_center infor-title" @tap="downapp()">
				<view>安卓版&nbsp;&nbsp;&nbsp;点击下载</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				android:"",
				ios:"",
				_token:"",
			};
		},
		onLoad(opt) {
			this._token = opt.appDownKey;
			this.init();
		},
		methods: {
			init(){
				const $token = uni.getStorageSync('token')||this._token;
				let params ={
					_token: $token,
					type:15
				}
				this.$api.getConfigImg(params).then(res => {
					if(res.ok&&res.data.length>0){
						this.android = res.data[0].pathurl;
						this.ios = res.data[1].pathurl;
					}
				});
			},
			downapp(){
				//下载app，请点击右上角的点在浏览器下载app
				//#ifdef H5
				window.location.href = this.android;
				//#endif
				//#ifdef APP-PLUS
				plus.runtime.openURL(this.android);
				//#endif
			},
		}
	};
</script>

<style lang="scss" scoped>
	.invBtn{
		width: 80%;
		height: 72rpx;
		background-color: #ffaa00;
		border-radius: 36rpx;
		font-size: 30rpx;
		color:#fff;
		line-height: 72rpx;
	}
	.bg-img{
		position: relative;
		width: 100%;
		height: 100%;
		background:url(https://www.ynbinlishenghuo.com:1803/app/images/com.png) no-repeat center;
		background-size: 100% 100%;
		border-radius: 16rpx;
		box-shadow: 0 0 20px #3168D9;
		position: absolute;
		bottom: 0;
		left: 50%;
		transform: translate(-50%, 0);
		text-align: center;
	}
	.infor-title{
		    margin: 21px;
		    font-size: 18px;
			color: #fff;
			font-weight: 600;
	}
	.downloadbg{
		width: 100%;
		position: fixed;
		/* #ifdef APP-PLUS */
		height: 100vh;
		top:0px;
		/* #endif */
		/* #ifndef APP-PLUS */
		height: calc(100vh - 88rpx);
		top:0px;
		/* #endif */
		left: 0;
		bottom: 0 !important;
		right: 0;
		z-index: 1;
	}
	.download_box{
		width: 100%;
		position: fixed;
		top:155px !important;
		z-index: 5;
	}
</style>
